

#ifndef TCPMESSAGEDEVICE_H
#define TCPMESSAGEDEVICE_H

#include "../../include/TMessageRouter.h"
DECLARE_MESSAGE_ROUTER(TCPMessageRouter);

// include MassiveConnectionDevice declaration
#include "ConnectionDevice.h"

class TCPMessageRouter:public SAF::IMessageRouter
{
public: 
	virtual bool Init(SAF::IKernel*, SAF::IConfig*);
	virtual void Release();
public:
	virtual bool SendNetMessage(const SAF::IConnection *, const SAF::NetMessage&, const SAF::NetBuffer *, unsigned int count);
	virtual bool RecvNetMessage(SAF::IConnection *&, SAF::NetPackage &, unsigned int time);
	//virtual bool BindConnection(unsigned long, void *);
	virtual bool DropConnection(const SAF::IConnection *);
private:	
	MMONetwork::Server::MassiveConnectionDevice	*	m_device;
	void *											m_defkey;
	SAF::IKernel *									m_hostKernel;
};


#endif	//#ifndef TCPMESSAGEDEVICE_H
